n = int(input())
fish , last = 1 , 1
while True:
    total , k = fish , True
    for i in range(n):
        if (total - 1) % n == 0:
            total = total // n * (n - 1)
        else:
            k = False
            break
    if k :
        print(fish)
        print(last)
        break
    fish += 1



